<%@ page info="Person results"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>

<%@page import="nl.avans.osgi.persistence.dm.person.model.Person" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OSGi trail Person list</title>
</head>
<body>
<h2>Person list with OSGi</h2>
<c:choose>
    <c:when test="${empty employeesList}">
        <p>There is no Person data found.</p>
    </c:when>
    <c:otherwise>
        <table>
            <thead>
                <tr>
                    <td>ID</td>
                    <td>First Name</td>
                    <td>Last Name</td>
                    <td>Gender</td>
                    <td>Street</td>
                    <td>Number</td>
                    <td>Postal code</td>
                    <td>City</td>
                    <td>Country</td>
                </tr>
            </thead>
            <tbody>
            <c:foreach items="${employeesList}" var="employee">
                <tr>
                    <td><c:out value="${employee.id}" /></td>
                    <td><c:out value="${employee.firstName}" /></td>
                    <td><c:out value="${employee.lastName}" /></td>
                    <td><c:out value="${employee.gender}" /></td>
                    <td><c:out value="${employee.address.street}" /></td>
                    <td><c:out value="${employee.address.number}" /></td>
                    <td><c:out value="${employee.address.postalcode}" /></td>
                    <td><c:out value="${employee.address.city}" /></td>
                    <td><c:out value="${employee.address.country}" /></td>
                </tr>
            </c:foreach>
            </tbody>
        </table>
    </c:otherwise>
</c:choose>
</body>
</html>